<?php


namespace chixian\Libraries\HttpServer;


use Hyperf\HttpServer\Response as ResponseHyperf;
use Psr\Http\Message\ResponseInterface as ResponseInterfacePsr;

class Response extends ResponseHyperf implements ResponseInterface
{
    /**
     * rjson格式化
     * @param array $data
     * @param int $recode
     * @param string $msg
     * @return ResponseInterfacePsr
     */
    public function rJson(array $data = [], int $recode = 0, string $msg = '成功'): ResponseInterfacePsr
    {
        return $this->json(['recode' => $recode, 'msg' => $msg, 'data' => $data]);
    }
}